package day2;

import java.io.FileInputStream;
import java.io.FileNotFoundException;

import org.junit.Test;

import day1.Student;

public class Demo {
	
	public static void main(String[] args) {
		// AbstractBird abstractBird = new AbstractBird();
		AbstractBird bird = new GeZi();
		GeZi geZi = new GeZi();
		
		
	}
	
	@Test
	public void test1() {
		Student student = null;
		// NullPointerException
		// null.方法()   null.属性
		//int age = student.getAge();
		
		int[] array = new int[3];
		// ArrayIndexOutOfBoundsException
		System.out.println(array[3]);
	}
	
	@Test
	public void test2() throws FileNotFoundException {
		FileInputStream fileInputStream = new FileInputStream("a.txt");
	}
	
	@Test
	public void test3()  {
		// 编译时异常：写代码时候不去处理就会报错
		try {
			FileInputStream fileInputStream = new FileInputStream("a.txt");
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		}
		System.out.println("Demo.test3()");
	}
}
